﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CapNhatKhohang.aspx.cs"
    Inherits="ThoiTrangT2B.Admin.CapNhatKhohang" MasterPageFile="~/Admin/AdminSite.Master"
    EnableEventValidation="true" MaintainScrollPositionOnPostback="true" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">

    <script>
        isLarge = false;
        $(document).ready(function() {
            $("#statExp").click(function() {
                $("#Expland").animate({ height: (isLarge ? '50px' : '400px') });
                isLarge = !isLarge;
            });
        }); 
    </script>

    <div class="NoiDungChinh">
        <img class="FormImage" src="images/computer.png" />
        <p class="FormTitle">
            Cập nhật kho hàng</p>
    </div>
    <div class="NoiDung">
        <style>
            .SanPham
            {
                width: 100%;
                float: left;
                border: solid 1px #AAA !important;
                max-width: 300px;
            }
            .Ten
            {
                clear: both;
                font-family: Arial;
                font-size: 30px;
                color: #333;
            }
            .Gia
            {
                clear: both;
                font-family: Arial;
                font-size: 16px;
                color: #ED505C;
                font-weight: bold;
            }
            .ExplandTitle
            {
                color: #FFF;
                font-size: 14px;
                font-weight: bold;
                background-color: #EC1C24;
                margin: 0 !important;
                padding: 3px;
            }
        </style>
        <div style="margin: 10px">
            <div style="width: 320px; float: left; padding-right: 15px; min-width: 320px;">
                <asp:Image ID="IMGSanPham" runat="server" CssClass="SanPham" />
            </div>
            <div style="width: 640px; float: left">
                <asp:Label ID="TenSanPham" runat="server" CssClass="Ten"></asp:Label>
                <br />
                <asp:Label ID="MaSanPham" runat="server" CssClass="Ten"></asp:Label>
                <br />
                <asp:Label ID="GiaSanPham" runat="server" CssClass="Gia"></asp:Label>
                <br />
                <asp:Label ID="GiaKhuyenMai" runat="server" CssClass="Gia"></asp:Label>
                <div id="Expland" style="position: relative; float: left; height: 50px; width: inherit;
                    background-color: #DDD; overflow: scroll">
                    <p id="statExp" class="ExplandTitle">
                        Thêm mới màu sắc / kích cỡ cho sản phẩm</p>
                    <br />
                    <asp:Button ID="btnAdd" runat="server" Text="Thêm mới" CssClass="cmdBtn" OnClick="btnAdd_Click" />
                    <table class="FormTable">
                        <tr>
                            <td>
                                <div class="dtlSize">
                                    <asp:DataList ID="dtlMauSac" runat="server" RepeatDirection="Horizontal" OnItemDataBound="dtlMauSac_ItemDataBound">
                                        <ItemTemplate>
                                            <center>
                                                <div class="color-tag" style='background-color: <%# Eval("TenDM")%>'>
                                                </div>
                                                <asp:CheckBox ID="chkColor" runat="server" CssClass="fl" />
                                                <asp:FileUpload ID="fulImage" runat="server" Width="130px" />
                                                <asp:HiddenField ID="hdnID" runat="server" Value='<%# Eval("ID")%>' />
                                                <asp:CheckBoxList ID="chkSizeList" runat="server" CssClass="FeatureLabel">
                                                </asp:CheckBoxList>
                                            </center>
                                        </ItemTemplate>
                                    </asp:DataList>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div style="clear: both">
            <asp:GridView ID="grvData" runat="server" AutoGenerateColumns="False" CssClass="ListTable"
                OnRowCommand="grvData_RowCommand" OnRowCancelingEdit="grvData_RowCancelingEdit"
                OnRowEditing="grvData_RowEditing" OnRowDeleting="grvData_RowDeleting" DataKeyNames="ID">
                <Columns>
                    <asp:TemplateField HeaderText="Màu sắc">
                        <ItemTemplate>
                            <div style='width: 50px; height: 50px; background-color: <%# Eval("MauSac")%>'>
                            </div>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Kích cỡ">
                        <ItemTemplate>
                            <%# "Size " + Eval("Size") %>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Số lượng">
                        <ItemTemplate>
                            <%# Eval("SL") %>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        <EditItemTemplate>
                            <asp:TextBox ID="txtSoLuong" runat="server" Text='<%# Eval("SL") %>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Cập nhật số lượng">
                        <HeaderStyle Wrap="False"></HeaderStyle>
                        <ItemStyle Wrap="False" Width="60px" HorizontalAlign="Center"></ItemStyle>
                        <ItemTemplate>
                            <asp:ImageButton ID="ingUpdate" runat="server" ImageUrl="../images/edit.gif" ToolTip="Cập nhật"
                                CommandArgument='<%# Eval("ID")%>' CommandName="edit"></asp:ImageButton>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:ImageButton ID="imgUpdate" runat="server" ImageUrl="../images/approval.png"
                                ToolTip="Cập nhật" CommandArgument='<%# Eval("ID")%>' CommandName="<%# ThoiTrangT2B.MyConst.Action.Approve %>">
                            </asp:ImageButton>
                            <asp:ImageButton ID="imgCancel" runat="server" CommandName="Cancel" ImageUrl="../images/cancel.png"
                                CommandArgument='<%# Eval("ID") %>' />
                        </EditItemTemplate>
                        <ItemStyle Width="70px"></ItemStyle>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
